package view;

import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.SpinnerDateModel;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class CreateCustomerView extends javax.swing.JPanel
{
	private JLabel lblName;
	private JLabel lblSecondName;
	private JLabel lblAdressOfBill;
	private JLabel lblCompanyname;
	private JLabel lblNotice;
	private JLabel lblDiscount;
	private JLabel lblTelephoneNumber;
	private JLabel lblEmail;
	private JLabel lblWeb;
	private JLabel lblFax;
	private JLabel lblDayOfBirth;

	private JTextField txtFirstName;
	private JTextField txtSecondName;
	private JTextField txtAdressOfBill;
	private JTextField txtCompanyname;
	private JTextField txtNotice;
	private JTextField txtDiscount;
	private JTextField txtTelephoneNumber;
	private JTextField txtEmail;
	private JTextField txtWeb;
	private JTextField txtFax;
	private JSpinner txtDayOfBirth;

	private JButton btnSave;
	private JButton btnCancel;
	private SpinnerDateModel dateSpinnerModel;
	

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
		
	public CreateCustomerView() {
		super();
		initGUI();
	}
	

	private void initGUI() {
		try {
			
			GridLayout thisLayout = new GridLayout(0, 2);
			thisLayout.setColumns(2);
			thisLayout.setHgap(5);
			thisLayout.setVgap(5);
			this.setLayout(thisLayout);
			this.setSize(new java.awt.Dimension(420, 300));
			{
				lblName = new JLabel();
				lblName.setHorizontalTextPosition(JLabel.CENTER);
				this.add(lblName);
				lblName.setText("First Name");
			}
			{
				txtFirstName = new JTextField();
				this.add(getTxtFirstName());
			}
			{
				lblSecondName = new JLabel();
				this.add(lblSecondName);
				lblSecondName.setText("Second Name");
			}
			{
				txtSecondName = new JTextField();
				this.add(getTxtSecondName());
			}
			{
				lblAdressOfBill = new JLabel();
				this.add(lblAdressOfBill);
				lblAdressOfBill.setText("Adress of Bill");
			}
			{
				txtAdressOfBill = new JTextField();
				this.add(getTxtAdressOfBill());
			}
			{
				lblDayOfBirth = new JLabel();
				this.add(lblDayOfBirth );
				lblDayOfBirth .setText("Birthday");
			}
			{
				dateSpinnerModel = new SpinnerDateModel();
				this.txtDayOfBirth = new JSpinner(dateSpinnerModel);
				txtDayOfBirth.setEditor(new JSpinner.DateEditor(txtDayOfBirth, "dd-MM-yyyy"));
				this.add(txtDayOfBirth);
			}
			{
				lblCompanyname = new JLabel();
				this.add(lblCompanyname);
				lblCompanyname.setText("Name of Company");
			}
			{
				txtCompanyname = new JTextField();
				this.add(getTxtCompanyname());
			}
			{
				lblNotice = new JLabel();
				this.add(lblNotice);
				lblNotice.setText("Notice");
			}
			{
				txtNotice = new JTextField();
				this.add(getTxtNotice());
			}
			{
				lblDiscount = new JLabel();
				this.add(lblDiscount);
				lblDiscount.setText("Discount");
			}
			{
				txtDiscount = new JTextField();
				this.add(getTxtDiscount());
			}
			{
				lblTelephoneNumber = new JLabel();
				this.add(lblTelephoneNumber);
				lblTelephoneNumber.setText("Telephonenumber");
			}
			{
				txtTelephoneNumber = new JTextField();
				this.add(getTxtTelephoneNumber());
			}
			{
				lblEmail = new JLabel();
				this.add(lblEmail);
				lblEmail.setText("Email Address");
			}
			{
				txtEmail = new JTextField();
				this.add(getTxtEmail());
			}
			{
				lblWeb = new JLabel();
				this.add(lblWeb);
				lblWeb.setText("Web Address");
			}
			{
				txtWeb = new JTextField();
				this.add(getTxtWeb());
			}
			{
				lblFax = new JLabel();
				this.add(lblFax);
				lblFax.setText("Fax Address");
			}
			{
				txtFax = new JTextField();
				this.add(getTxtFax());
			}
			{
				btnSave = new JButton("Save");
				this.add(btnSave);
			}
			{
				
				btnCancel = new JButton("Cancel");
				this.add(btnCancel);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void addActionsListeners(ActionListener listener)
	{
		btnSave.addActionListener(listener);
		btnCancel.addActionListener(listener);		
	}


	public JLabel getLblName()
	{
		return lblName;
	}


	public void setLblName(JLabel lblName)
	{
		this.lblName = lblName;
	}


	public JLabel getLblSecondName()
	{
		return lblSecondName;
	}


	public void setLblSecondName(JLabel lblSecondName)
	{
		this.lblSecondName = lblSecondName;
	}


	public JLabel getLblAdressOfBill()
	{
		return lblAdressOfBill;
	}


	public void setLblAdressOfBill(JLabel lblAdressOfBill)
	{
		this.lblAdressOfBill = lblAdressOfBill;
	}


	public JLabel getLblCompanyname()
	{
		return lblCompanyname;
	}


	public void setLblCompanyname(JLabel lblCompanyname)
	{
		this.lblCompanyname = lblCompanyname;
	}


	public JLabel getLblNotice()
	{
		return lblNotice;
	}


	public void setLblNotice(JLabel lblNotice)
	{
		this.lblNotice = lblNotice;
	}


	public JLabel getLblDiscount()
	{
		return lblDiscount;
	}


	public void setLblDiscount(JLabel lblDiscount)
	{
		this.lblDiscount = lblDiscount;
	}


	public JLabel getLblTelephoneNumber()
	{
		return lblTelephoneNumber;
	}


	public void setLblTelephoneNumber(JLabel lblTelephoneNumber)
	{
		this.lblTelephoneNumber = lblTelephoneNumber;
	}


	public JLabel getLblEmail()
	{
		return lblEmail;
	}


	public void setLblEmail(JLabel lblEmail)
	{
		this.lblEmail = lblEmail;
	}


	public JLabel getLblWeb()
	{
		return lblWeb;
	}


	public void setLblWeb(JLabel lblWeb)
	{
		this.lblWeb = lblWeb;
	}


	public JLabel getLblFax()
	{
		return lblFax;
	}


	public void setLblFax(JLabel lblFax)
	{
		this.lblFax = lblFax;
	}


	public JTextField getTxtFirstName()
	{
		return txtFirstName;
	}


	public void setTxtFirstName(JTextField txtFirstName)
	{
		this.txtFirstName = txtFirstName;
	}


	public JTextField getTxtSecondName()
	{
		return txtSecondName;
	}


	public void setTxtSecondName(JTextField txtSecondName)
	{
		this.txtSecondName = txtSecondName;
	}


	public JTextField getTxtAdressOfBill()
	{
		return txtAdressOfBill;
	}


	public void setTxtAdressOfBill(JTextField txtAdressOfBill)
	{
		this.txtAdressOfBill = txtAdressOfBill;
	}


	public JTextField getTxtCompanyname()
	{
		return txtCompanyname;
	}


	public void setTxtCompanyname(JTextField txtCompanyname)
	{
		this.txtCompanyname = txtCompanyname;
	}


	public JTextField getTxtNotice()
	{
		return txtNotice;
	}


	public void setTxtNotice(JTextField txtNotice)
	{
		this.txtNotice = txtNotice;
	}


	public JTextField getTxtDiscount()
	{
		return txtDiscount;
	}


	public void setTxtDiscount(JTextField txtDiscount)
	{
		this.txtDiscount = txtDiscount;
	}


	public JTextField getTxtTelephoneNumber()
	{
		return txtTelephoneNumber;
	}


	public void setTxtTelephoneNumber(JTextField txtTelephoneNumber)
	{
		this.txtTelephoneNumber = txtTelephoneNumber;
	}


	public JTextField getTxtEmail()
	{
		return txtEmail;
	}


	public void setTxtEmail(JTextField txtEmail)
	{
		this.txtEmail = txtEmail;
	}


	public JTextField getTxtWeb()
	{
		return txtWeb;
	}


	public void setTxtWeb(JTextField txtWeb)
	{
		this.txtWeb = txtWeb;
	}


	public JTextField getTxtFax()
	{
		return txtFax;
	}


	public void setTxtFax(JTextField txtFax)
	{
		this.txtFax = txtFax;
	}


	public JButton getBtnSave()
	{
		return btnSave;
	}


	public void setBtnSave(JButton btnSave)
	{
		this.btnSave = btnSave;
	}


	public JButton getBtnCancel()
	{
		return btnCancel;
	}


	public void setBtnCancel(JButton btnCancel)
	{
		this.btnCancel = btnCancel;
	}


	public JLabel getLblDayOfBirth() {
		return lblDayOfBirth;
	}


	public void setLblDayOfBirth(JLabel lblDayOfBirth) {
		this.lblDayOfBirth = lblDayOfBirth;
	}


	public JSpinner getTxtDayOfBirth() {
		return txtDayOfBirth;
	}

	public Date getBirthday(){
		return dateSpinnerModel.getDate();
	}
	
	public void setBirthday(Date bday){
		dateSpinnerModel.setValue(bday);
	}

	
}
